#define _CRT_SECURE_NO_WARNINGS 1

#include"contact.h"

int main()
{
	AddressBook con;

	int input = 0;

	InitialAddressBook(&con);

	do
	{
		system("cls");
		display();

		printf("Please input function choice:>");
		scanf("%d", &input);

		switch (input)
		{
		case ADD:
			addInfo(&con);
			break;
		case DEL:
			delInfo(&con);
			break;
		case SEARCH:
			searchInfo(&con);
			break;
		case MODIFY:
			modifyInfo(&con);
			break;
		case SHOW:
			showInfo(&con);
			break;
		case SORT:
			sortByAgeInfo(&con);
			break;
		case EXIT:
			saveData(&con);
			freeMemory(&con);
			break;
		default:
			printf("Invalid input! Please choose again!");
			Sleep(1500);
			break;
		}
	} while (input);
}
